package main
import "fmt"
import "errors"

func readFile(filename string) error {
	if (filename == "main.go") {
		return nil
	} else {
		return errors.New("File not found")
	}
}

func myFn() {
	defer func() {
		err := recover();
		if err != nil {
			fmt.Println("文件不存在")
		}
	}()
	err := readFile("xxx.go")
	if err != nil {
		panic(err)
	}
}

func main() {
	myFn()
	fmt.Println("程序继续执行了")
}